<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:76:"/data/www/html/web2017/public_html/../application/index/view/user/login.html";i:1497837826;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <link href="__STATIC__/admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">

    <link href="/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/static/admin/css/animate.min.css" rel="stylesheet">
    <link href="/static/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/static/admin/css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="/static/admin/css/plugins/switchery/switchery.css" rel="stylesheet">
    <link href="/static/admin/css/style.min.css?v=4.1.0" rel="stylesheet">
    <link href="/static/admin/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/static/admin/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="/static/admin/js/content.min.js?v=1.0.0"></script>
    <script src="/static/admin/js/plugins/chosen/chosen.jquery.js"></script>
    <script src="/static/admin/js/plugins/iCheck/icheck.min.js"></script>
    <script src="/static/admin/js/plugins/layer/laydate/laydate.js"></script>
    <script src="/static/admin/js/plugins/switchery/switchery.js"></script><!--IOS开关样式-->
    <script src="/static/admin/js/jquery.form.js"></script>
    <script src="/static/admin/js/layer/layer.js"></script>
    <script src="/static/admin/js/laypage/laypage.js"></script>
    <script src="/static/admin/js/laytpl/laytpl.js"></script>
    <script src="/static/admin/js/lunhui.js"></script>
    <style>
        .gray-bg{font-family: "Microsoft Yahei"}
        .bg{background:#37AA87;height: 100%;}
        .pic{border:2px #fff solid; width: 92px;height:92px;margin:0 auto; border-radius: 45px;background-image: url('__STATIC__/index/images/head_default.gif');}
        .zh{margin-top:15px;border-bottom: 1px #fff solid; color: #fff;}
        .text{ background:#37AA87;border:0;width: 200px;color:#fff;margin-left: 15px; }
        .bs1{height:40px;line-height:40px; vertical-align: middle; margin-top:30px;}
        .bs2{height:40px;line-height:40px; vertical-align: middle; margin-top:15px;}
        .button{width:200px;height:40px;text-align: center;margin: 0 auto;border:1px #fff solid;color: #fff;}
    </style>

</head>
<body class="gray-bg">
<div class="wrapper wrapper-content bg">
    <form class="form-horizontal m-t" name="login" id="login" method="post" action="login">
            <div class="row">
                <div class="col-sm-12" style="height: 120px;">
                    <div class="pic"></div>
                </div>

                <!--<div class="col-sm-12 zh">-->
                    <!--<p><i class="fa fa-user"></i>&nbsp;&nbsp;&nbsp;角色:-->
                        <!--<select name="role" class="text" >-->
                                <!--<option value="1">学生</option>-->
                                <!--<option value="2">家长</option>-->
                                <!--<option value="1">教师</option>-->
                                <!--<option value="1">教育局</option>-->
                                <!--<option value="1">编辑</option>-->
                                <!--<option value="1">其他</option>-->
                        <!--</select>-->
                    <!--</p>-->
                <!--</div>-->

                <div class="col-sm-12 zh">
                    <p><i class="fa fa-user"></i>&nbsp;&nbsp;&nbsp;帐号:<input class="text" id="username" type="text" name="username" > </p>
                </div>
                <div class="col-sm-12 zh">
                    <p><i class="fa fa-lock"></i>&nbsp;&nbsp;&nbsp;密码:<input  class="text" id="password" type="password" name="password" ></p>
                </div>

                <div class="col-sm-12 bs1" >
                   <div class="button"><button type="submit" style="width: 100%;border:0px; background:#37AA87;height: 38px;">登录</button> </div>
                </div>

                <div class="col-sm-12 bs2">
                    <a href="<?php echo url('index/user/user_reg'); ?>"><div class="button">注册</div></a>
                </div>
            </div>
        </form>
</div>

<script type="text/javascript">



    $(function(){
        $('#login').ajaxForm({
            beforeSubmit: checkForm, // 此方法主要是提交前执行的方法，根据需要设置
            success: complete, // 这是提交后的方法
            dataType: 'json'
        });

        function checkForm(){

            if( '' == $.trim($('#username').val())){
                layer.msg('帐号不能为空', {icon: 5,time:1500,shade: 0.1}, function(index){
                    layer.close(index);
                });
                return false;
            }
            if( '' == $.trim($('#password').val())){
                layer.msg('密码不能为空', {icon: 5,time:1500,shade: 0.1}, function(index){
                    layer.close(index);
                });
                return false;
            }

        }

        function complete(data){
            console.log(data);
            if(data.code == 1){
                window.location.href="<?php echo url('index/index'); ?>";
            }else{
                layer.msg(data.msg, {icon: 5,time:1500,shade: 0.1}, function(index){
                    layer.close(index);
                });
                return false;
            }
        }

    });
</script>


</body>
</html>